package com.project.zsxd.server.calendar.controller;


import com.alibaba.fastjson.JSONObject;
import com.project.zsxd.server.calendar.service.ICalendarService;
import com.project.zsxd.server.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * <p>
 * 日历表 前端控制器
 * </p>
 *
 * @author kaler
 * @since 2021-08-29
 */
@RestController
@RequestMapping("/calendar")
public class CalendarController {

    @Autowired
    private ICalendarService calendarService;

    @RequestMapping("/initData")
    public Result initData(@RequestBody JSONObject param) throws ParseException {
        String startDateText = param.getString("startDate");
        String endDateText = param.getString("endDate");
        calendarService.initData(startDateText,endDateText);
        return Result.success(null);
    }

}
